#include "etoolbar.h"

EToolBar::EToolBar(int x,int y,int w,int h) : CGroup("",10,SP_ALIGN_NONE)
{
    box(FL_PLASTIC_DOWN_BOX);
    size(w,h);
    position(x,y);

    Radio=new Fl_Light_Button(x+5,y+25,w-10,20,"Radio");
    Radio->labelsize(10);
    Radio->box(FL_PLASTIC_UP_BOX);
    Radio->callback(secim_CB,this);
    Radio->color2(FL_GREEN);
    Radio->value(1);
    tip="Radio";

    Check=new Fl_Light_Button(x+5,y+70,w-10,20,"Check");
    Check->deactivate();
    Check->labelsize(10);
    Check->box(FL_PLASTIC_UP_BOX);
    Check->callback(secim_CB,this);
    Check->color2(FL_GREEN);

    Label=new Fl_Light_Button(x+5,y+115,w-10,20,"Label");
    Label->labelsize(10);
    Label->box(FL_PLASTIC_UP_BOX);
    Label->callback(secim_CB,this);
    Label->color2(FL_GREEN);

    Metin=new Fl_Light_Button(x+5,y+160,w-10,20,"Metin");
    Metin->labelsize(10);
    Metin->box(FL_PLASTIC_UP_BOX);
    Metin->callback(secim_CB,this);
    Metin->color2(FL_GREEN);

    Resim=new Fl_Light_Button(x+5,y+205,w-10,20,"Resim");
    Resim->labelsize(10);
    Resim->box(FL_PLASTIC_UP_BOX);
    Resim->callback(secim_CB,this);
    Resim->color2(FL_GREEN);

    Anim=new Fl_Light_Button(x+5,y+250,w-10,20,"Anim");
    Anim->labelsize(10);
    Anim->box(FL_PLASTIC_UP_BOX);
    Anim->callback(secim_CB,this);
    Anim->color2(FL_GREEN);

}

EToolBar::~EToolBar()
{
    //dtor
}
void EToolBar::secim_CB(Fl_Widget *p,void *userdata)
{
    EToolBar *gecici=(EToolBar *)userdata;
    gecici->secim_CB2(p);
}
void EToolBar::secim_CB2(Fl_Widget *p)
{
    Fl_Light_Button *gecici=dynamic_cast<Fl_Light_Button *>(p);
    Radio->value(0);
    Resim->value(0);
    Check->value(0);
    Label->value(0);
    Anim->value(0);
    Metin->value(0);
    gecici->value(1);
    tip=gecici->label();
}
std::string EToolBar::tipGonder()
{
    return tip;
}
